﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/CompanyConsole.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadHolder" runat="server">
<script type="text/javascript">
    $(function () {
        myAccordion.showThisHideOpen(contents[1]);
    });
    function deleteItem(sender, id) {
        if (confirm('您确定要删除该条留言吗？')) {
            $.get('/OnlineItemDelete', { mid: id }, function (result) {
                if (result == '1') {
                    if (result != '1') {
                        $('#msgbox').html("<div id=\"processmsgbox\" style=\"height:20px; padding-top:5px; background-color:Red; text-align:center; color:White; font-weight:bold;\">操作失败，请稍候再试</div>");
                        hideProcessMsgBox();
                    }
                    else {
                        $('#msgbox').html("<div id=\"processmsgbox\" style=\"height:20px; padding-top:5px; background-color:Green; text-align:center; color:White; font-weight:bold;\">操作成功</div>");
                        window.setTimeout(function () { window.location.href = "/OnlineMG"; }, 1000);

                    }
                }
            });
        }
    }
</script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyHolder" runat="server">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="17" height="29" valign="top" background="/Content/images/Console/mail_leftbg.gif">
                <img src="/Content/images/Console/left-top-right.gif" width="17" height="29" />
            </td>
            <td width="935" height="29" valign="top" background="/Content/images/Console/content-bg.gif">
                <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg"
                    id="table2">
                    <tr>
                        <td height="31">
                            <div class="titlebt">
                                留言管理</div>
                        </td>
                    </tr>
                </table>
            </td>
            <td width="16" valign="top" background="/Content/images/Console/mail_rightbg.gif">
                <img src="/Content/images/Console/nav-right-bg.gif" width="16" height="29" />
            </td>
        </tr>
        <tr>
            <td height="71" valign="middle" background="/Content/images/Console/mail_leftbg.gif">
                &nbsp;
            </td>
            <td valign="top" bgcolor="#F7F8F9">
                <table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td height="13" valign="top">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td class="left_txt" style="border-bottom:1px solid #aaa;">
                                        当前位置：留言板管理
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table style="margin-top:10px;" width="100%" height="55" border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td width="10%" height="55" valign="middle">
                                                    <img src="/Content/images/Console/title.gif" width="54" height="55">
                                                </td>
                                                <td width="90%" valign="top">
                                                    <span class="left_txt2">请在这里编辑发布能的产品<span
                                                        class="left_txt2">！</span><br/>
                                                    <span class="left_txt2">通常</span><span class="left_txt3">您应该在这里尽量详细的描述您的产品以及售后服务等信息</span><span class="left_txt2">。</span>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table style="margin-top:10px;" width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="nowtable">
                                            <tr>
                                                <td class="left_bt2" style="width:35%;">
                                                    &nbsp;&nbsp;&nbsp;&nbsp;留言板管理
                                                    
                                                </td>
                                                 <td id="msgbox">
                                                 </td>&nbsp;
                                                <td>
                                                </td>
                                                <td align="right" style="width:35%;">
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>  
                                    <div id="newsbox">
                                    
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <%var list = ViewData["Data"] as List<DefaultDataPack>;
                                          foreach (var item in list)
                                          { %>
                                        <tr>
                                            <td colspan="2" height="20" width="40%" style="border-bottom: 1px solid #ccc">
                                                <a href="/OnlineEditMG?mid=<%=item.ID %>" id="likTitle">
                                                    <%:item.DATE %>【<%:item.AUTHOR %>】留言<img src="/Content/images/pencil.png" style="border:none;" />编辑、回复</a>
                                                <a href="javascript:;" onclick="deleteItem(this,'<%=item.ID %>')">
                                                <img style="border:none;" src="/Content/images/Console/cancel.png" />删除</a>
                                            </td>
                                            <td align="right">&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td colspan="3"><p><%:item.CONTENT %></p></td>
                                        </tr>
                                        <tr>
                                            <td style="border-bottom:1px solid #ccc">最新回复:&nbsp;&nbsp;</td>
                                            <td style="border-bottom:1px solid #ccc">
                                            <%if (item.ISREPLY)
                                              { %>
                                            【<%:item.EXTFIELD2%><%if (!String.IsNullOrEmpty(item.PHONE))
                                                                  { %>[联系电话：<%:item.PHONE%>]<%} %>】回复到：
                                            <%}
                                              else
                                              { %>
                                              暂无回复
                                              <%} %>
                                            </td>
                                           <td>&nbsp;</td>
                                        </tr>
                                        <%if (item.ISREPLY)
                                          { %>
                                        <tr>
                                        <td colspan="3"><p style="color:red;"><%:item.EXTFIELD1%></p></td>
                                        </tr>
                                        <%} %>
                                        <tr><td align="right" colspan="3" style="border-bottom:1px solid #ccc"><a target="_blank" href="/Online?page=<%:Request["page"] == null?"0":Request["page"] %>">查看详细&gt;&gt;</a></td></tr>
                                        <%} %>
                                        <tr height="30">
                                            <td colspan="2" align="left" style="padding-left:30px;">
                                                <div style="float:left;">
                                                    <a href="?page=0"><img style="border:none;" src="/Content/images/pagination_first.gif" /></a>
                                                    <a href="?page=<%:list[0].PREVIOUSPAGE %>"><img style="border:none;" src="/Content/images/pagination_prev.gif" /></a>
                                                </div>
                                                <div style="padding-top:1px; float:left;">当前第<%:list[0].CURRENTPAGE %>/<%:list[0].PAGECOUNT %>页</div> 
                                                <div>
                                                     <a href="?page=<%:list[0].NEXTPAGE %>"><img style="border:none;" src="/Content/images/pagination_next.gif" /></a>
                                                    <a href="?page=<%:list[0].LASTPAGE %>"><img style="border:none;" src="/Content/images/pagination_last.gif" /></a>

                                                </div>
                                            </td>
                                            <td height="17" align="center">
                                                &nbsp;
                                            </td>
                                        </tr>
                                    </table>
                                    </div>
                                    <div id="editbox" style="display:none;">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">

                                            </table>
                                    </div>
                                    </td>
                                </tr>
                            </table>
                           
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td valign="middle" background="/Content/images/Console/mail_leftbg.gif">
                <img src="/Content/images/Console/buttom_left2.gif" width="17" height="17" />
            </td>
            <td height="17" valign="top" background="/Content/images/Console/buttom_bgs.gif">
                <img src="/Content/images/Console/buttom_bgs.gif" width="17" height="17" />
            </td>
            <td background="/Content/images/Console/mail_rightbg.gif">
                <img src="/Content/images/Console/buttom_right2.gif" width="16" height="17" />
            </td>
        </tr>
    </table>
</asp:Content>